fix(storage): add samples for bucket encryption encoforcement config#16045
fix(storage): add samples for bucket encryption encoforcement config#16045bajajneha27 wants to merge 9 commits intogoogleapis:mainfrom
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces new C++ samples for the Google Cloud Storage client library, specifically focusing on managing bucket encryption enforcement configurations. These examples provide practical demonstrations of how to programmatically interact with and control the encryption policies for storage buckets, covering operations like retrieving current settings, applying new enforcement rules, and clearing existing configurations. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request adds new samples for managing bucket encryption enforcement configurations. The changes are well-structured and the new sample code correctly demonstrates the usage of the API. All original comments have been retained as they align with general C++ best practices and the Google C++ Style Guide, and none of the provided rules contradict them.
| std::cout << "\nCreating bucket to run the example (" << bucket_name << ")" | ||
| << std::endl; |
There was a problem hiding this comment.
Per the Google C++ Style Guide, you should use \n instead of std::endl. std::endl also flushes the stream, which is often unnecessary and can impact performance.
std::cout << "\nCreating bucket to run the example (" << bucket_name << ")\n";References
- The repository style guide defers to the Google C++ Style Guide, which states to use
\ninstead ofstd::endlto avoid performance issues with flushing the stream. (link)
| std::cout << "\nRunning the SetBucketEncryptionEnforcementConfig() example" | ||
| << std::endl; |
There was a problem hiding this comment.
Per the Google C++ Style Guide, you should use \n instead of std::endl. std::endl also flushes the stream, which is often unnecessary and can impact performance.
std::cout << "\nRunning the SetBucketEncryptionEnforcementConfig() example\n";References
- The repository style guide defers to the Google C++ Style Guide, which states to use
\ninstead ofstd::endlto avoid performance issues with flushing the stream. (link)
| std::cout << "\nRunning the GetBucketEncryptionEnforcementConfig() example [1]" | ||
| << std::endl; |
There was a problem hiding this comment.
Per the Google C++ Style Guide, you should use \n instead of std::endl. std::endl also flushes the stream, which is often unnecessary and can impact performance.
std::cout << "\nRunning the GetBucketEncryptionEnforcementConfig() example [1]\n";References
- The repository style guide defers to the Google C++ Style Guide, which states to use
\ninstead ofstd::endlto avoid performance issues with flushing the stream. (link)
| std::cout << "\nRunning the RemoveAllEncryptionEnforcementConfig() example" | ||
| << std::endl; |
There was a problem hiding this comment.
Per the Google C++ Style Guide, you should use \n instead of std::endl. std::endl also flushes the stream, which is often unnecessary and can impact performance.
std::cout << "\nRunning the RemoveAllEncryptionEnforcementConfig() example\n";References
- The repository style guide defers to the Google C++ Style Guide, which states to use
\ninstead ofstd::endlto avoid performance issues with flushing the stream. (link)
| std::cout << "\nRunning the GetBucketEncryptionEnforcementConfig() example [2]" | ||
| << std::endl; |
There was a problem hiding this comment.
Per the Google C++ Style Guide, you should use \n instead of std::endl. std::endl also flushes the stream, which is often unnecessary and can impact performance.
std::cout << "\nRunning the GetBucketEncryptionEnforcementConfig() example [2]\n";References
- The repository style guide defers to the Google C++ Style Guide, which states to use
\ninstead ofstd::endlto avoid performance issues with flushing the stream. (link)
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #16045 +/- ##
==========================================
- Coverage 92.68% 92.68% -0.01%
==========================================
Files 2342 2343 +1
Lines 216537 216626 +89
==========================================
+ Hits 200700 200782 +82
- Misses 15837 15844 +7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
4fac04b to
aefe810
Compare
5b15454 to
6216fdb
Compare
| // For the update, need to specify all three configs, so keeping this same | ||
| // as before | ||
| encryption.customer_supplied_encryption_enforcement_config | ||
| .restriction_mode = "FullyRestricted"; |
There was a problem hiding this comment.
on line number 149, we write encryption = original->encryption();
Wouldn't this be enough?
There was a problem hiding this comment.
I'm sorry I didn't follow. What would not be enough?
No description provided.